﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Mathmall.Administration.Migrations
{
    /// <inheritdoc />
    public partial class ChangeAttrTableCatalogIDFieldToInt : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "CatalogID",
                table: "Attr",
                type: "int",
                nullable: true,
                comment: "所属分类",
                oldClrType: typeof(byte),
                oldType: "tinyint",
                oldNullable: true,
                oldComment: "所属分类");

            migrationBuilder.AlterColumn<string>(
                name: "AttrName",
                table: "Attr",
                type: "char(30)",
                nullable: false,
                defaultValue: "",
                comment: "属性名",
                oldClrType: typeof(string),
                oldType: "char(30)",
                oldNullable: true,
                oldComment: "属性名");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<byte>(
                name: "CatalogID",
                table: "Attr",
                type: "tinyint",
                nullable: true,
                comment: "所属分类",
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true,
                oldComment: "所属分类");

            migrationBuilder.AlterColumn<string>(
                name: "AttrName",
                table: "Attr",
                type: "char(30)",
                nullable: true,
                comment: "属性名",
                oldClrType: typeof(string),
                oldType: "char(30)",
                oldComment: "属性名");
        }
    }
}
